/**
 * Covalent Server Header File
 * 
 * File:        socket_helper.h
 * Brief:       BRIEF
 * Author:      Chen Kangbing
 * Email:       ckblau@outlook.com
 * Modified:    2021/10/08 17:24:01
 *
 */


#ifndef SOCKET_HELPER_H
#define SOCKET_HELPER_H

#ifdef __cplusplus
extern "C" {
#endif 


#include <sys/socket.h>
#include <arpa/inet.h>

#include "prototype.h"


int socket_init_server(ServerTypeDef *psrv);
int socket_loop_listen(ServerTypeDef *psrv, WorkerTaskTypeDef *ptask);
int transmit_down(WorkerThreadTypeDef *pworker);
int transmit_up(WorkerThreadTypeDef *pworker);
void task_shutdown(WorkerTaskTypeDef *ptask);
void worker_reset(WorkerThreadTypeDef *pworker);
void socket_deinit_server(ServerTypeDef *psrv);


#ifdef __cplusplus
}
#endif 

#endif
